doctype html

- baseTitle = process.env.SITE_TITLE || 'Block Explorer'
- staticRoot = process.env.STATIC_ROOT || ''
- pageTitle = prerender_title ? `${prerender_title} · ${baseTitle}` : baseTitle
- bodyClass = theme ? `theme-${theme}` : ''

- cssPath = t ? t`style.css` : 'style.css'
- lang = t ? t.lang_id : 'en'
- dir = t ? t`ltr` : 'ltr'

head
  meta(charset='utf-8')
  title= pageTitle
  meta(property='og:title', content=process.env.OG_TITLE || process.env.SITE_TITLE || 'Block explorer')
  meta(name='description', content=process.env.SITE_DESC || 'Esplora Block Explorer')

  if canon_url
    link(rel="canonical", href=canon_url)

  if !noscript && process.env.NOSCRIPT_REDIR
    noscript: meta(http-equiv='refresh', content="0; url='?nojs'")

  base(href=process.env.BASE_HREF || '/')

  meta(name='viewport', content='width=device-width, initial-scale=1')
  link(rel='shortcut icon', type='image/png', href=staticRoot+'img/favicon.png')
  link(rel='stylesheet', href=staticRoot+'bootstrap.min.css')
  link(rel='stylesheet', href=staticRoot+cssPath)

  if process.env.CANONICAL_URL
    //- open search requires the absolute URL of the explorer
    link(rel='search', href=staticRoot+'opensearch.xml', type='application/opensearchdescription+xml', title=process.env.SITE_TITLE || 'Block Explorer')

  != process.env.HEAD_HTML

body(class=bodyClass, lang=lang, dir=dir)
  #explorer!= prerender_html || ''

  if !noscript
    script(src=staticRoot+'app.js', async)
  != process.env.FOOT_HTML
